package org.myminidao.utils;

import org.myminidao.conf.pojo.MyDaoConfiguration;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class XStreamUtil {
	private static XStream CONFIG_XSTREAM = null;
	
	public static XStream getConfigXStream() {
		if(CONFIG_XSTREAM == null){
            synchronized (XStreamUtil.class){
                if(CONFIG_XSTREAM == null){
                	CONFIG_XSTREAM = new XStream(new DomDriver("UTF-8"));
                	CONFIG_XSTREAM.autodetectAnnotations(true);
                	CONFIG_XSTREAM.processAnnotations(MyDaoConfiguration.class);
                }
            }
        }
		
		return CONFIG_XSTREAM;
	}
}
